
// 在API目录，创建js文件，定义角色管理接口
import request from '@/utils/request'

const base_url = '/admin/system/sysUser'

export default{
    // 1、条件分页查询
    userPageSel(page, limit, sysUserQueryVo){
        return request({
            url: `${base_url}/${page}/${limit}`,
            method: 'get',
            params: sysUserQueryVo
        })
    },
    // 2、添加用户
    userSave(sysUser){
        return request({
            url: `${base_url}/userSave`,
            method: 'post',
            data: sysUser
        })
    },
    // 3、更新用户
    userGet(id){
        return request({
            url: `${base_url}/userGet/${id}`,
            method: 'get',
        })
    },
    userUpdate(sysUser){
        return request({
            url: `${base_url}/userUpdate`,
            method: 'put',
            data: sysUser
        })
    },
    // 4、删除用户
    userRemove(id){
        return request({
            url: `${base_url}/userRemove/${id}`,
            method: 'delete',
        })
    },
    // 5、批量删除用户
    userBatchRemove(idList){
        return request({
            url: `${base_url}/userBatchRemove`,
            method: 'delete',
            data: idList
        })
    },

    // 6、更新用户状态
    updateStatus(id, status){
        return request({
            url: `${base_url}/updateStatus/${id}/${status}`,
            method: 'get',
        })
    }
}